<template>
  <form action="/">
    <van-search
        v-model="value"
        show-action
        placeholder="请输入搜索关键词"
        @search="onSearch"
        @cancel="onCancel"
    />
  </form>
</template>

<script>
export default {
  name: "Search",
  data() {
    return {
      value: "",
    }
  },

  methods: {
    onSearch(val) {
      this.$router.push({name:"search", query:{title:val}})

    },
    onCancel() {
      this.$router.go(-1)
    }
  }


}
</script>

<style scoped lang="less">


</style>